/**
 * 
 */
package lu.peersoft.timesheet



/**
 * @author thor
 *
 */
class SimpleAuthenticator extends Authenticator {
  private String username, password;

  public SimpleAuthenticator(config) {
    this.username = config.simpleAuthenticator.@username;
    this.password = config.simpleAuthenticator.@password;
    System.properties.putAll([
      "proxySet": config.simpleAuthenticator.@proxySet,
      "proxyHost": config.simpleAuthenticator.@proxyHost,
      "proxyPort": config.simpleAuthenticator.@proxyPort]);
  }

  protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password.toCharArray());
  }
}

